-
-
Notifications
You must be signed in to change notification settings - Fork 915
Allow throwing an access denied exception on denormalization of secured properties #7221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
throw AccessDeniedException when security conditions for an operation or property aren't met on denormalize
Not sure what the reason is for failure:
Relevant tests pass locally and this class does exist in branch and |
Amazing contribution! Do you think that we can use |
Ah @soyuka I see - because it's a new feature, I based my branch off |
It should be available on the main branch already, indeed you can rebase against main if you don't have the changes locally. |
@soyuka yeah it is now, it wasn't when I first did the branch but after syncing my fork and updating, looks all good. I've added some lint fixes and updated another serializer test where this code change means prophecy needed an extra expectation, you have a few other CI failures on this PR; they don't appear related to me, but have a look at it again and let me know if anything else needs changing. |
Tyvm @dwgebler I'll soon release an alpha version of API Platform 4.2! |
Throw AccessDeniedException when security conditions for an operation or property aren't met on denormalize
Supports adding
throw_on_access_denied
(bool) as a value inextra_properties
on an Operation or ApiProperty so that during denormalization, if any security condition is not met anAccessDeniedException
is thrown instead of silently reverting the property to its previous value.